package lzk.myshop.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CartMapper {
    @Select("select id from cart where `userid` = #{userid}")
    int selectbyuserid(int userid);

    @Insert("insert into cart (`userid`) values (#{userid})")
    int save(int userid);

    @Select("select `userid` from `cart` where `id` = #{id}")
    int getUserIDByID(int id);
    @Delete("delete from `cartdetail` where `id` = #{id}")
    int deleteCartDetail(int id);
}
